#ifndef ros_robot_MAIN_WINDOW_H
#define ros_robot_MAIN_WINDOW_H

#include <QtGui/QMainWindow>
#include "ui_main_window.h"
#include "qnode.hpp"

#include "CCtrlDashBoard.hpp"
#include <QProcess>

namespace ros_robot {
    class MainWindow : public QMainWindow {
    Q_OBJECT

    private:
        Ui::MainWindowDesign ui;
        QNode qnode;

        CCtrlDashBoard* speed_x_dashBoard;
        CCtrlDashBoard* speed_y_dashBoard;

        QProcess* cmd;

    public:
        
        MainWindow(int argc, char** argv, QWidget *parent = 0);
        ~MainWindow();
        
        void ReadSettings(); // 在启动时加载qt程序设置
        void WriteSettings(); // 关闭时保存qt程序设置
        void closeEvent(QCloseEvent *event); // 重载函数
        void showNoMasterMessage();//提示RosMaster未启

    public Q_SLOTS:
        void on_actionAbout_triggered();
        void on_button_connect_clicked(bool check );
        void on_checkbox_use_environment_stateChanged(int state);

        void slot_linear_value_changed(int);
        void slot_angular_value_changed(int);
        void slot_pushButton_click();
        void slot_update_dashBoard(float x,float y);
        void slot_update_power(float value);
        
        void slot_update_image(QImage);
        void slot_sub_image();
        
        void slot_pushButton_start_turtlebot3_clicked();
        void slot_pushButton_shutdowm_turtlebot3_clicked();
        void slot_pushButton_cmd_clicked();
        void slot_textEdit_output();
    };
}
#endif // ros_robot_MAIN_WINDOW_H
